package com.by.mapper.purchase;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.by.condition.purchase.PurchaseCondition;
import com.by.entity.purchase.Purchase;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;
import java.util.Map;

@Mapper
public interface PurchaseMapper extends BaseMapper<Purchase> {

    /**
     * 保存采购申请单
     * @param purchase
     * @return
     */
    int savePurchase(Purchase purchase);


    /**
     * 查询最大编码
     * @return
     */
    String queryMaxCode();

    /**
     * 查询采购申请列表
     * @param condition
     * @return
     */
    List<Map> query(PurchaseCondition condition);

    /**
     * 根据id查询采购申请
     * @param id
     * @return
     */
    Purchase queryById(String id);
}
